package cn.jiyun.controller;

import cn.jiyun.pojo.Ceshi;
import cn.jiyun.pojo.Emp;
import org.springframework.web.bind.annotation.*;

import javax.sound.midi.Soundbank;
import javax.validation.Valid;

@RestController
public class LogController  {
    @RequestMapping("log")
    public String hello(){
        System.out.println("-----hello-------");
        return "hello";
    }

    @GetMapping("login/{name}/{mm}")
    public String login(@PathVariable String name,@PathVariable String mm){
        System.out.println("----"+name+mm);
        return "请求成功";
    }

    @PostMapping("add")
    public String add(Emp emp){
        System.out.println(emp);
        return emp.toString();
    }

    @PostMapping("addCeshi")
    public String add(@Valid Ceshi ceshi){
        System.out.println(ceshi);
        return ceshi.toString();
    }

    @DeleteMapping("del")
    public String del(){
        System.out.println("del");
        return "成功";
    }
    //修改请求
    @PutMapping("put")
    public String put(){
        System.out.println("put");
        return "成功";
    }

}
